from selenium import webdriver
import time


driver = webdriver.Firefox()
driver.get('https://www.baidu.com')
driver.maximize_window()

# 获取网页标题
title = driver.title
print(title)

# 获取网页url
url = driver.current_url
print(url)

# 获取网页的文本信息
driver.find_element_by_id('kw').send_keys('selenium')
driver.find_element_by_id('su').click()
url1 = driver.current_url
print(url1)

nums = driver.find_element_by_class_name('nums_text').text
print(nums)


time.sleep(1)
driver.quit()

